﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.Logging;

namespace EasyDDD.Infrastructure.EFCore.Records
{
    public class EFRecordsContext<TContext> : DbContext
        where TContext : DbContext
    {

        public EFRecordsContext(DbContextOptions<TContext> options, IServiceProvider provider)
           : base(options)
        {
          
        }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.LogTo(Console.WriteLine, LogLevel.Information);
            optionsBuilder.UseLazyLoadingProxies();
            //optionsBuilder.UseChangeTrackingProxies();
            base.OnConfiguring(optionsBuilder);
        }

        public IDbContextTransaction? CurrentTransaction => throw new NotImplementedException();

        public IDbContextTransaction BeginTransaction()
        {
            throw new NotImplementedException();
        }

        public Task CommitAsync(CancellationToken cancellationToken)
        {
            throw new NotImplementedException();
        }

        public Task RollbackAsync(CancellationToken cancellationToken)
        {
            throw new NotImplementedException();
        }

        public int SaveChange(CancellationToken cancellationToken = default)
        {
            throw new NotImplementedException("查询不能实现SaveChange");
        }

        public Task<int> SaveChangeAsync(CancellationToken cancellationToken = default)
        {
            throw new NotImplementedException("查询不能实现SaveChangeAsync");
        }

       
    }
}
